<?php       
	$diadiemdulich = $viewModel->get('diadiemdulich'); 
	$hinhanhs = $viewModel->get('hinhanhs'); 
	$videos = $viewModel->get('videos'); 
	$baiviets = $viewModel->get('baiviets'); 
	$diadiemgannhats = $viewModel->get('diadiemgannhats'); 
	$diadiemmuonxems = $viewModel->get('diadiemmuonxems'); 
	$baiviets = $viewModel->get('baiviets'); 

 ?>
<section class="main_content">
		<div class="container">
			<div class="row">
				<p class="sitemap">
					<a href="<?php echo BASE_URL; ?>">Trang chủ</a> <span class="glyphicon glyphicon-play"></span>
					<a href="<?php echo BASE_URL.'diadiemdulich/province/'.$diadiemdulich->AliasTinhThanh; ?>"><?php echo $diadiemdulich->TenTinh; ?></a> <span class="glyphicon glyphicon-play"></span> 
					<a href="<?php echo BASE_URL.'diadiemdulich/'.$diadiemdulich->AliasTinhThanh.'/'.$diadiemdulich->AliasLoaiDiaDiem; ?>"><?php echo $diadiemdulich->TenLoaiDiaDiem; ?></a> <span class="glyphicon glyphicon-play"></span>
					<?php echo $diadiemdulich->TenDiem; ?>
				</p>
				<div class="col-xs-12 col-md-12">
					<div class="col-xs-12 col-md-4">
						
						<h1><?php echo $diadiemdulich->TenDiem; ?></h1>
						<p><span class="glyphicon glyphicon-map-marker"></span> <?php echo $diadiemdulich->DiaChi; ?></p>
					</div>
					<div class="col-md-2 col-xs-6">
							<div class="metro-bottom">
								<a href="#map">
									<span class="glyphicon glyphicon-map-marker icon1"></span>
									<p class="title2">Bản đồ</p>
								</a>
							</div>
						</div>
						<div class="col-md-2 col-xs-6">
							<div class="metro-bottom">
								<a href="#description">
									<span class="glyphicon glyphicon-th-large icon1"></span>
									<p class="title2">Giới thiệu</p>
								</a>
							</div>
						</div>
						<div class="col-md-2 col-xs-6">
							<div class="metro-bottom">
								<a href="#picture-clip">
									<span class="glyphicon glyphicon-picture icon1"></span>
									<p class="title2">Hình ảnh / Clip</p>
								</a>
							</div>
						</div>
						<div class="col-md-2 col-xs-6">
							<div class="metro-bottom">
								<a href="#articles">
									<span class="glyphicon glyphicon-bookmark icon1"></span>
									<p class="title2">Bài viết</p>
								</a>
							</div>
						</div>
					
					
				
				</div>
			</div>
			<div class="row">
				<div class="col-xs-12 col-md-9">
					<h2 class="module">Bản đồ</h2>
					<div class="map" id="map">
						
					</div>
					<script type="text/javascript">
					      function initialize() {
					      	var myLatlng = new google.maps.LatLng(<?php echo $diadiemdulich ->ViDo ?>,<?php echo $diadiemdulich ->KinhDo ?>);
					        var mapOptions = {
					          center: myLatlng,
					          zoom: 14
					        };
					        var map = new google.maps.Map(document.getElementById('map'),
					            mapOptions);
					       var infoWindow = new google.maps.InfoWindow;

					        // current place					        
					      		
					      		var contentString = '<div class="row1 info_place">'+
					       							'<div class="col-md-4">'+
						       						'<img src="<?php echo PATH_IMAGE_PLACE.$diadiemdulich->HinhAnh ?>" class="image_place">'+	
					       							'</div>'+
					       							'<div class="col-md-8">'+
						       							'<h1><?php echo $diadiemdulich->TenDiem; ?></h1>'+
						       							'<?php echo $diadiemdulich->DiaChi; ?>'+
					       							'</div>'+
					       						'</div>';
					       		var marker = new google.maps.Marker({
						            map: map,
						            position: myLatlng,
						            icon: 'http://hoangquancantho.com.vn/wp-content/themes/phuan/images/map/single-family-home-map-icon.png'
						          });
					       		infoWindow.setContent(contentString);
						        infoWindow.open(map, marker);
						        bindInfoWindow(marker, map, infoWindow, contentString);

					        //end curent place
					        <?php foreach($diadiemgannhats as $diadiemgannhat) {?>
					      		var point = new google.maps.LatLng(<?php echo $diadiemgannhat ->ViDo ?>,
						              <?php echo $diadiemgannhat ->KinhDo ?>);
					      		
					      		var contentString = '<div class="row1 info_place">'+
					       							'<div class="col-md-4">'+
						       						'<img src="<?php echo PATH_IMAGE_PLACE.$diadiemgannhat->HinhAnh ?>" class="image_place">'+	
					       							'</div>'+
					       							'<div class="col-md-8">'+
						       							'<h1><?php echo $diadiemgannhat->TenDiem; ?></h1>'+
						       							'<?php echo $diadiemgannhat->DiaChi; ?>'+
					       							'</div>'+
					       						'</div>';
					       		<?php $icon = PATH_ICON.$diadiemgannhat->LoaiDiaDiem.'.png'; ?>
					       		var marker = new google.maps.Marker({
						            map: map,
						            position: point,
						     		icon: '<?php echo $icon ?>'
						          });
					       		bindInfoWindow(marker, map, infoWindow, contentString);
					      	<?php } ?>  
					      	
					    //      var marker = new google.maps.Marker({
							  //     position: myLatlng,
							  //     map: map,
							  //     title: 'Hello World!'
							  // });
					       

					      }
					      //end  function initialize()
					      function bindInfoWindow(marker, map, infoWindow, html) {
						      google.maps.event.addListener(marker, 'click', function() {
						        infoWindow.setContent(html);
						        infoWindow.open(map, marker);
						      });
    }
					      
					      google.maps.event.addDomListener(window, 'load', initialize);
					 </script>
					<h2 class="module"><?php if($diadiemdulich->MoTa) {echo 'Giới thiệu';} ?></h2>				
					<p class="description" id="description">

						<?php echo $diadiemdulich->MoTa; ?>	
					</p>	
					<h2 class="module" id="picture-clip"><?php if($hinhanhs){ echo 'Hình ảnh về '.$diadiemdulich->TenDiem; }?></h2>
					<p>
					 <?php foreach ($hinhanhs as $hinhanh) { ?>                                    
						<img src="<?php echo PATH_IMAGE_PLACE.$hinhanh->DuongDan ?>" alt="" class="img-thumbnail image-location">
					<?php } ?>	
					</p>
					<h2 class="module" id="clip"><?php if($videos){ echo 'Video về '.$diadiemdulich->TenDiem; }?></h2>
					<p>
					 <?php foreach ($videos as $video) { ?>                                    
						<iframe width="49%" height="300" src="//<?php echo $video->DuongDan ?>" frameborder="0" allowfullscreen></iframe>
					<?php } ?>
					</p>		
					<?php if(!empty($baiviets)) { ?>
					<h2 class="module" id="articles">Bài viết về <?php echo $diadiemdulich->TenTinh; ?></h2>	
					<div class="row">
					<?php foreach ($baiviets as $baiviet) { ?>                                    
						  <div class="col-xs-12 col-md-6">
						  		<div class="media">
									  <a class="pull-left" href="#">
									    <img class="media-object" height="70px" width="70px" src="<?php if(!empty($baiviet->AnhThumb)){echo $baiviet->AnhThumb;}else{echo PATH_IMAGE.'bai-viet.png';}  ?>" alt="...">
									  </a>
									  <div class="media-body">
									    <h4 class="media-heading"><a href="#"><?php echo $baiviet->TieuDe ?></a></h4>
									    <p><?php echo $baiviet->MoTa ?></p>
									  </div>
								</div>
						  </div>
					 <?php } ?>		  
					</div>	
					<?php 	} ?>							
				</div>
					<!-- Map -->
				

  				<div class="col-xs-12 col-md-3">
  					<h2 class="module">Địa điểm gần đây</h2>
  					<?php foreach ($diadiemgannhats as $diadiemgannhat) { ?>                                    
  					<div class="media">
					  <a class="pull-left" href="<?php echo BASE_URL.'diadiemdulich/place/'.$diadiemgannhat->Alias ?>">
					    <img class="media-object" height="70px" width="70px" src="<?php echo PATH_IMAGE_PLACE.$diadiemgannhat->HinhAnh ?>" alt="...">
					  </a>
					  <div class="media-body">
					    <h3 class="media-heading"><a href="<?php echo BASE_URL.'diadiemdulich/place/'.$diadiemgannhat->Alias ?>"><?php echo $diadiemgannhat->TenDiem ?></a></h3>
					    <p class="address"><?php echo $diadiemgannhat->DiaChi ?></p>
					    <p><span class="glyphicon glyphicon glyphicon-eye-open rate"> <?php echo number_format($diadiemgannhat->SoLuotXem) ?></span><span class="distance"><?php echo number_format($diadiemgannhat->distance,2) ?> km</span></p>
					  </div>
					</div>
					<?php } ?>
					<hr>

					<!-- Có thể muốn xem -->
					<h2 class="module">Có thể bạn muốn xem</h2>
  					<?php foreach ($diadiemmuonxems as $diadiemmuonxem) { ?>                                    
  					<div class="media">
					  <a class="pull-left" href="<?php echo BASE_URL.'diadiemdulich/place/'.$diadiemmuonxem->Alias ?>">
					    <img class="media-object" height="70px" width="70px" src="<?php echo PATH_IMAGE_PLACE.$diadiemmuonxem->HinhAnh ?>" alt="...">
					  </a>
					  <div class="media-body">
					    <h3 class="media-heading"><a href="<?php echo BASE_URL.'diadiemdulich/place/'.$diadiemmuonxem->Alias ?>"><?php echo $diadiemmuonxem->TenDiem ?></a></h3>
					    <p class="address"><?php echo $diadiemmuonxem->DiaChi ?></p>
					    <p><span class="glyphicon glyphicon glyphicon-eye-open rate"> <?php echo number_format($diadiemmuonxem->SoLuotXem) ?></span><!-- <span class="distance"><?php echo number_format($diadiemgannhat->distance,2) ?> km</span> --></p>
					  </div>
					</div>
					<?php } ?>
					<hr>
					<!-- promotion -->
					<img src="<?php echo PATH_IMAGE ?>banner-tour2.jpg" height="300px" width="100%" alt="">
  				</div>
				
			</div>
		<div>
	</section>
	<hr>